/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.framework.business;

import br.com.menosehmais.framework.persistence.DataAccessObject;
import br.com.menosehmais.framework.persistence.DomainObject;
import java.util.List;

/**
 *
 * @author Rafael Quintino Gomes Rosa
 */
public class CrudBusinessObject< DO extends DomainObject, DAO extends DataAccessObject<DO> > extends DatabaseBusinessObject<DO,DAO>  implements ICrudBusinessObject<DO>{

    public CrudBusinessObject( DAO dao ){
        super(dao);
    }

    @Override
    public DO insert(DO domainObject) {
        return dao.insert(domainObject);
    }

    @Override
    public void delete(DO domainObject) {
        dao.delete(domainObject);
    }

    @Override
    public DO update(DO domainObject) {
        return dao.update(domainObject);
    }

    @Override
    public DO selectById(String id) {
        return dao.selectById(id);
    }

    @Override
    public List<DO> findAll() {
        return dao.selectAll();
    }

    @Override
    public List<DO> findAll(DO domainObject) {
        return dao.selectUsingFilter(domainObject);
    }
}
